package com.situ.springboot.pattern;

// 枚举类可以非常方便的控制对象的个数
enum Sex {
    MALE, FEMALE;
}

/*final class Sex extends Enum<Sex> {
    public static final Sex MALE;
    public static final Sex FEMALE;

    private Sex(String name, int ordinal) {
        super(name, ordinal);
    }

    static {
        // 会放到静态代码块中执行，静态代码块里面的线程安全由虚拟机来保证
        MALE = new Sex("MALE", 0);
        FEMALE = new Sex("FEMALE", 1);
    }
}*/
